<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>三个数排序</title>
</head>

<body>
    <input type="text" id="numX" placeholder="请输入第一个数">
    <input type="text" id="numY" placeholder="请输入第二个数">
    <input type="text" id="numZ" placeholder="请输入第三个数">
    <button onclick="sortNums()">排序</button>
    <div id="sortResult"></div>
    <script>
        function sortNums() {
            var numX = parseFloat(document.getElementById('numX').value);
            var numY = parseFloat(document.getElementById('numY').value);
            var numZ = parseFloat(document.getElementById('numZ').value);
            var resultDiv = document.getElementById('sortResult');
            var arr = [numX, numY, numZ].sort(function (a, b) {
                return a - b;
            });
            resultDiv.innerHTML = "排序后的结果: " + arr.join(', ');
        }
    </script>
</body>

</html>